home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tiger Disk 5
/
Tiger_Disk_005_19xx_Tiger-Crew-Disk_de_Side_B.d64
/
3d_4 gewinnt[pl]
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
6KB
|
163 lines
0 l=1:dim fa(200),f(20),g(40):x$="":gosub4500
1 print"[147]":p(1)=0:p(2)=14:restore
4 print"":fort=1to125:fa(t)=0:nextt
6 print""
7 print"";chr$(142)
8 print""
9 print""
10 print" [164][164] [164][164] [164][164] [164][164] [164][164] "
11 print" [205] [205] [205] [205] [205] [205] [205] [205] [205] [205]"
12 print" [205] [205] [205] [205] [205] [205] [205] [205] [205] [205]"
13 print" [205] [205] [205] [205] [205] [205] [205] [205] [205] [205]"
14 print" [205] [205] [205] [205] [205] [205] [205] [205] [205] [205]"
15 print" [205] [205] [205] [205] [205] [205] [205] [205] [205] [205]"
16 print" [163][163] [163][163] [163][163] [163][163] [163][163]":ifgh=1thenreturn
17 poke198,0:printx$"spieler"l"ist dran.":poke53280,254
18 print"ihr zug (tiefe,breite):"
19 input t,b
22 gosub100:if t<1ort>5 then print"[145][145]":goto19
23 if b<1orb>5 then print"[145][145]":goto19
24 if h<1orh>5 then print"[145][145]":goto19
25 xy=(t*5-5)+b+(h*25-25):iffa(xy)<>0then print"[145][145]":goto19
30 if xy>25thenjhg=0:iffa(xy-25)=0then print"[145][145]":goto19
32 q=(1470-t*41)+41+b*7-7-h*40+40
40 poke q-41,79:fa(xy)=l:pokeq-41+54272,p(l)
41 iffa(xy+20)<>0thengoto 44
42 iffa(xy+15)<>0thenpokeq-40,119:pokeq,79:goto 46
43 poke q-39,77:pokeq-40,119:pokeq+54272-39,p(l):pokeq+54272-40,p(l)
44 ifxy>5thenjhg=0:iffa(xy-5)<>0then goto 46
45 poke q,79:poke q+1,80:pokeq+54272,p(l):pokeq+54273,p(l)
46 if xy>25then poke q-1,116
47 if gh=1thenreturn
50 poke53265,0
51 for t=1to 13:kl=1
52 read f(t):nextt:fort=1to13:poke53280,int(16*rnd(1))+1
53 kl=0:if xy<f(t) then goto 55
54 if fa(xy-f(t))=lthen y=f(t):gosub 900
55 if fa(xy+f(t))=lthen y=f(t):gosub 900
56 ifkl=1thenforvb=1to20:read aq:nextvb:kl=.
57 next t:l=l+1:ifl=3thenl=1
58 poke53265,27
59 restore:print"[145][145][145][145]":goto17
100 xy=t*5-5+b
101 if fa(xy)=0thenh=1:return
102 if fa(xy+25)=0thenh=2:return
103 if fa(xy+50)=0thenh=3:return
104 if fa(xy+75)=0thenh=4:return
105 if fa(xy+100)=0thenh=5:return
106 h=6:return
900 kl=.:forr=1to20:readg(r)
903 forhy=-100to100 step 25
904 if xy-y=g(r)+hythenifxy-2*y=g(r)+hythenifxy-3*y=g(r)+hythen za=1
910 if xy-y=g(r)+hythenifxy+y=g(r)+hythenifxy-2*y=g(r)+hythen zb=1
920 if xy-y=g(r)+hythenifxy+y=g(r)+hythenifxy+2*y=g(r)+hythen zc=1
930 if xy+y=g(r)+hythenifxy+3*y=g(r)+hythenifxy+2*y=g(r)+hythen zc=1
939 nexthy:nextr
941 if za=1andzb=1andzc=1andzd=1thenreturn
998 poke53265,27
999 if za=1thenza=0:goto1008
1000 if xy-2*y<1orxy-3*y<1then goto1009
1002 if fa(xy-y)=l and fa(xy-2*y)=l and fa(xy-3*y)=lthen print"spieler"l:end
1008 if zb=1thenzb=0:goto1011
1009 if xy+y>125orxy-2*y<1then goto1012
1010 if fa(xy-y)=land fa(xy+y)=land fa(xy-2*y)=lthen print"spieler"l:end
1011 if zc=1thenzc=0:goto1015
1012 if xy+y>125orxy+2*y>125orxy-y<1then 1015
1013 if fa(xy-y)=landfa(xy+y)=landfa(xy+2*y)=lthen print"spieler"l:end
1014 if xy+y>125orxy+2*y>125orxy+3*y>125 then return
1015 if zd=1thenzd=0:goto1020
1016 if fa(xy+y)=landfa(xy+2*y)=landfa(xy+3*y)=lthen print"spieler"l:end
1020 return
2000 data 31,30,29,26,25,24,21,20,19,6,5,4,1
2100 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
2110 data 1,2,3,4,5,21,22,23,24,25,0,0,0,0,0,0,0,0,0,0
2120 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
2130 data 21,16,11,6,1,25,20,15,10,5,0,0,0,0,0,0,0,0,0,0
2140 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2150 data 21,16,11,6,1,25,20,15,10,5,0,0,0,0,0,0,0,0,0,0
2160 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
2170 data 21,22,23,24,25,1,2,3,4,5,0,0,0,0,0,0,0,0,0,0
2180 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
2190 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
2200 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
2210 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
2220 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
4500 print"[147] (a[146])nleintung"
4501 print" (s[146])piel"
4502 gett$:ift$="a"then5000
4503 ift$="s"thenreturn
4504 goto4502
5000 print"[147] [202]eder kennt doch das gewoehnliche";chr$(14)
5001 print" 4-[199]ewinnt. [196]a mir das zu oede war,"
5002 print" entschloss ich mich, etwas neues zu"
5003 print" programmieren....."
5004 fort=1to5000:nextt
5005 print"[147] [221][160][160][160]"
5006 print" [221] "
5007 print" [221] [221] "
5008 print" [173][192][219][192]"
5009 print" [221] [154][199]ewinnt ....."
5010 print" [177] "
5011 print" ":fort=1to2000:nextt
5012 print" [192][192][192][174]"
5013 print" [221]"
5014 print" [192][192][179]"
5015 print" [221]"
5020 print" [154] ...... in [192][192][192][189] [154] [196]imensionen."
5025 for t=1to3000:nextt
5026 print"[147] [196]ie [210]egeln sind dieselben wie bei"
5027 print" dem gewoehnlichem 4-[199]ewinnt. [196]er [213]nter-"
5028 print" schied ist, dass man [211]teine nicht nur"
5029 print" nebeneinander, sondern auch aufeinander"
5030 print" setzen kann."
5031 print" [197]in [211]pieler gewinnt, wenn er 4 [211]teine"
5032 print" in einer [210]eihe setzen konnte."
5033 print" [194]eispiel kommt ([211]pace druecken)"
5035 gett$:ift$<>" "then5035
5036 printchr$(142):gh=1:gosub 1
5037 t=1:b=1:l=1:gosub22:t=1:b=1:l=2:gosub22:l=1:t=2:b=2:gosub22
5038 l=2:t=2:b=2:gosub22:b=3:t=3:l=1:gosub22:l=2:gosub22:b=4:t=4:l=1:gosub22
5039 print" dieses spiel gewinnt spieler 1"
5040 print" (schwarz). der computer schreibt dann"
5041 print" 'spieler 1'. schlicht aber wir-"
5042 print" kungsvoll....."
5050 print" space druecken fuer weitere beispiele."
5051 gett$:ift$<>" "then5051
5052 gosub1
5053 t=5:b=5:l=2:gosub22:l=2:gosub22:l=2:gosub22:l=1:gosub22
5054 t=4:b=4:l=2:gosub22:gosub22:l=1:gosub22
5055 t=3:b=3:l=2:gosub22:l=1:gosub22
5056 t=2:b=2:l=1:gosub22
5060 gh=0:print" auch hier gewinnt spieler 1. ich denke,";
5061 print" diese beiden beispiele haben die "
5062 print" arbeitsweise dieses programmes klar-"
5063 print" gemacht."
5070 print" space druecken."
5071 gett$:ift$<>" "then5071
5080 print"[147] [202]etzt noch etwas zur [197]ingabe eines";chr$(14)
5081 print" [218]uges: [196]er [195]omputer erwartet bei der"
5082 print" [197]ingabe 2 '[203]oordinaten': [193]ls erstes"
5083 print" muss die [212]iefe eingegeben werden."
5084 print" [212]iefe besagt, ob der [211]tein weit"
5085 print" vorne (1) oder weit hinten (5) gesetzt"
5086 print" wird. [194]reite sagt dem [195]omputer, ob der"
5087 print" [211]tein ganz links (1) oder ganz rechts"
5088 print" (5) gesetzt wird."
5089 print" [211]pace druecken."
5090 gett$:ift$<>" "then5090
5100 print"[147] [200]ier die [203]oordinaten aller 4 [197]cken:"
5101 print" [204]inks, vorne (unten) = 1 , 1"
5103 print" [204]inks, hinten (oben) = 5 , 1"
5104 print" [210]echts, vorne (unten) = 1 , 5"
5105 print" [210]echts, hinten (oben) = 5 , 5"
5106 print" [196]ie beiden [203]oordinaten werden mit"
5107 print" einem [203]omma dazwischen eingegeben."
5108 print" [194]eispiele: 1,1 oder 2,3 oder 4,1 usw."
5109 print" [211]pace[146] druecken."
5110 gett$:ift$<>" "then5110
5120 printchr$(14):print"[147] [201]ch wuensche euch noch"
5121 print" viel [211]pass mit dem [211]piel[160]!"
5130 print" [208]hantom [204]ord[154] of [212]-[195][154]."
5150 fort=1to4000:nextt
5160 return